<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" href="../../../static/layui/css/layui.css" />
		<link rel="stylesheet" href="../../../static/css/bootstrap-theme.min.css" />
		<script src="../../../static/js/jquery-3.3.1.min.js"></script>

		<script>
			$(document).ready(function(){

				// 修改信息
				$('.updateStudent').click(function () {
					$.post(
							"${pageContext.request.contextPath}/updateStudentInfo",
							$('#studentInfoForm').serialize(),
							function (data) {
								if (data == 1) {
									var $url = "${pageContext.request.contextPath}" +"/jsp/admin/student/info.jsp";
									$(window).attr('location',$url);

								}
							}
					)
				});
			});
		</script>
	</head>
	<body>
		<div class="layui-card">
			<div class="layui-card-header">
				<h2>个人信息编辑</h2>
			</div>
			<form class="layui-form" id="studentInfoForm">
				<div class="layui-form-item">
					<label class="layui-form-label">学生ID</label>
					<div class="layui-input-inline">
						<input type="text" name="studentId" required lay-verify="required" value="${sessionScope.student.studentId}" placeholder="不可编辑" readonly="" autocomplete="off"
						 class="layui-input">
					</div>

				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">学生姓名</label>
					<div class="layui-input-inline">
							<input type="text" name="studentName" required lay-verify="required" value="${sessionScope.student.studentName}" placeholder="不可编辑" readonly="" autocomplete="off"
						 class="layui-input">
					</div>

				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">学生专业</label>
					<div class="layui-input-inline">
						<input type="text" name="studentMajor" required lay-verify="required" value="${sessionScope.student.studentMajor}" placeholder="不可编辑" readonly="" autocomplete="off"
						 class="layui-input">
					</div>

				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">选修总成绩</label>
					<div class="layui-input-inline">
						<input type="text" name="totalCredits" required lay-verify="required" value="${sessionScope.student.totalCredits}" placeholder="不可编辑" readonly="" autocomplete="off"
						 class="layui-input">
					</div>

				</div>

				<div class="layui-form-item layui-form-text">
					<label class="layui-form-label">个人描述</label>
					<div class="layui-input-block">
						<textarea name="studentDesc" placeholder="${sessionScope.student.studentDesc}"  class="layui-textarea">${sessionScope.student.studentDesc}</textarea>
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-input-block">
						<button class="layui-btn updateStudent" lay-submit lay-filter="updateStudent">立即提交</button>
					</div>
				</div>

			</form>
		</div>
		<script src="../../../static/layui/layui.js"></script>
		<script>
			//Demo

			layui.use('form', function() {
				var form = layui.form;

			});
		</script>
	</body>
</html>
